import requests
import requests.utils
from config.read_config import Read
import pytest

@pytest.fixture(scope='session')
def crm_token():
        url = Read().get_crm('url')
        tim = int(Read().get_crm('timeout'))
        crmdata = {'username':'admin', 'password': 123456}
        r = requests.post(url + '/login', data=crmdata, timeout=tim)
        toke = r.json()['Admin-Token']
        return toke


